package ChampionFactory;

import java.util.Observable;
import java.util.Random;

import Champion.Champion;

public abstract class AbstractChampionFactory extends Observable
{
	public static ChampionCorpsACorpsFactory cf0 = new ChampionCorpsACorpsFactory();
	public static ChampionADistanceFactory cf1 = new ChampionADistanceFactory();
	public static ChampionHybrideFactory cf2 = new ChampionHybrideFactory();
	private static boolean saison;

	public AbstractChampionFactory()
	{

	}

	/**
	 * @return a random Champion from the factories above. randomNum is an int
	 *         number in 0-2 range
	 */
	public final static Champion getChampion()
	{
		Random rand = new Random();
		int randomNum = rand.nextInt(3);
		switch (randomNum)
		{
		case 0:
			return cf0.createChampion();
		case 1:
			return cf1.createChampion();
		case 2:
			return cf2.createChampion();
		}

		return null;
	}

	public abstract Champion createChampion();
	
	public boolean getSaison(){
		return saison;
	}
	
	public void setSaison(boolean special){
		this.saison = special;
		setChanged();
		notifyObservers(this.saison);
		
	}

}